import os from 'os';
//使用userInfo()方法获取当前用户的相关信息
console.log(os.userInfo());
console.log(os.totalmem());
console.log(os.freemem());
console.log(os.cpus());